﻿using FySystem.Extension;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FySystem.IO
{
    public class CSonConverter
    {
        /// <summary>
        /// 将List<CSon>转换为CArray类型的CSon
        /// </summary>
        /// <param name="parks"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public static CSon ToCSonArray(List<CSon> parks)
        {
            CSon res = CSon.CSonArrayNull;
            try
            {
                if (parks.IsNullOrEmpty())
                    return res;

                foreach(var item in parks)
                {
                    res.Add(item);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return res;
        }
    }
}
